﻿//Include("Mz");

/**
 * @fileoverview 获取当前文档的scroll[Top|Left], 
 * documnet[Width|Height], view[Width|Height]这些属性
 * @author meizz
 * @version 20090426
 *
 * @name Mz.body
 * @namespace Mz.body
 * @return {Object} 返回一个JSON对象
 */
Mz.body = function() {
    var W=0, H=0, SL=0, ST=0, SW=0, SH=0;
    var w=window, d=document, dd=d.documentElement;

    W=dd.clientWidth||d.body.clientWidth;
    H= w.innerHeight||dd.clientHeight||d.body.clientHeight;

    ST=d.body.scrollTop ||dd.scrollTop;
    SL=d.body.scrollLeft||dd.scrollLeft;

    SW=Math.max(d.body.scrollWidth, dd.scrollWidth ||0);
    SH=Math.max(d.body.scrollHeight,dd.scrollHeight||0, H);

    return {
        "scrollTop":ST,
        "scrollLeft":SL,
        "documentWidth":SW,
        "documentHeight":SH,
        "viewWidth":W,
        "viewHeight":H
    };
};